﻿@using FwProject.Restaurant.Dto
@using FwProject.ManagerConfig.Dto
@using FwProject.Restaurant
@using FwProject.Comm
@model DepositDto
@{
    ConfigInfoDto config = ViewBag.Config;
}
@section styles{
    <style media="print" type="text/css">
        .Noprint {
            display: none;
        }

        .PageNext {
            page-break-after: always;
        }

        * {
            word-wrap: break-word;
            word-break: break-all;
        }

        body, td, th {
            font-family: Verdana, Arial, Helvetica, sans-serif;
            font-size: 12px;
            color: #1d1007;
            line-height: 20px;
        }

        table {
            border-collapse: collapse;
            border-spacing: 0px;
        }
    </style>
    <link href="/css/print.css" rel="stylesheet" />
}

<!-----------------------------【smsx.cab】打印--------------------------->
<object id="factory" viewastext style="display:none" classid="clsid:1663ed61-23eb-11d2-b92f-008048fdd814"
        codebase="/scripts/smsx.cab#Version=6,2,433,70"></object>
<!-----------------------------【smsx.cab】打印--------------------------->
<form name="printformName" id="printformName" action="" method="post">
    <div align="center">
        <div id="printObj" style="width: 190mm" align="center">
            <style>
                table {
                    border-collapse: collapse;
                    border-spacing: 0px;
                }
            </style>

            <!-----------------------------【smsx.cab】打印--------------------------->
            <!--打印前初始化设置-->
            <script language="javascript">

                p_init({
                    portrait: true//true纵向,false横向
                });

            </script>

            <p>
                <input type="button" name="printBtn" class="notprint" value="打印" onclick="pagePrint();" />
            </p>
            <!-----------------------------【smsx.cab】打印--------------------------->
            <div align="center" id="titleSpan" style="font-size: 14px; margin-top: 3px; margin-bottom: 15px; font-weight: bold;">
                @*添富集团（测试）<br />*@
                @*@if (Model.DepositType == DepositType.收押金)
                    {
                    @("收押金收据")
                    }
                    else
                    {
                    @("退押金收据")
                    }*@
            </div>
            <table name="mainTable" style="width:100%;height:auto;text-align: center;margin-bottom:0px;margin-top:1px;" border="0">
                <tr>
                    <td align='center' style='width:100%;'>
                        <table cellSpacing=0 cellPadding=0 style="width: 600px">
                            <tr>
                                <td align="center" width="100%" style="font-size: 22px;color:#000000;height: 35px;padding-top: 10px;" colspan="3">
                                    @config?.CorporateName
                                </td>
                            </tr>
                            <tr>
                                <td nowrap="nowrap" align="left" width="50%" style="font-size: 14px;color:#000000;height: 35px">地址：@config?.CorporateAddress</td>
                                <td nowrap="nowrap" align="right" width="50%" style="font-size: 14px;color:#000000;height: 35px">电话：@config?.CorporateMobile</td>
                            </tr>
                            <tr>

                                <td align="center" width="100%" style="font-size: 22px;color:#000000;height: 20px" colspan="3">

                                    押 &nbsp; &nbsp; 金 &nbsp; &nbsp; 收 &nbsp; &nbsp; 据

                                </td>


                            </tr>
                            <tr>
                                <td align="center" colspan="3" width="100%" style="height: 20px">
                                    @Model.CreationTime.ToString("yyyy-MM-dd")&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;No&nbsp;<span id='number'>@Model.CreationNumber</span>
                                </td>
                                <td rowspan="4" align="right" style="color:#000000;font-size:12px;line-height:12px;width:5px;padding-left: 2px;">一联存根<br /><br />二联餐厅<br /><br />三联记账</td>
                            </tr>
                            <tr>
                                <td align="left" colspan="2">
                                    <table name="justForJeDis" align='left' width='100%' cellSpacing=0 cellPadding=0 style='border:1px solid #000000;'>
                                        <tr>
                                            <td style='color: #000000;font-size: 16px;width: 100px;'>&nbsp;&nbsp;今&nbsp;&nbsp;收&nbsp;&nbsp;到</td>
                                            <td align='left' style='border-bottom: 1px solid #000000;height: 35px;font-size: 14px' colspan="2">
                                                &nbsp;@Model.RestaurantInfoModel.RestaurantName&nbsp;押金：@Model.Money.ToString("N")元
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>
                                                <div style='color: #000000;font-size: 16px;width: 100px;'>
                                                    &nbsp;&nbsp;金&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;额<br>&nbsp;&nbsp;人&nbsp;&nbsp;民&nbsp;&nbsp;币
                                                </div>
                                            </td>
                                            <td style='border-bottom: 1px solid #000000' colspan='2'>
                                                <table width='100%' cellSpacing=0 cellPadding=0>
                                                    <tr>
                                                        <td align='left' style='color: #000000;font-size: 16px;width: 60px;'>(大写)</td>
                                                        <td align="left" style='font-size: 16px;'>

                                                            <span name='jeAccountUpper'>@ViewBag.RMB</span>&nbsp;&nbsp;&nbsp;
                                                        </td>
                                                    </tr>
                                                </table>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td style='color: #000000;font-size: 16px;width: 100px;height: 40px;'>
                                                &nbsp;&nbsp;备&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;注
                                            </td>
                                            <td colspan='2'>
                                                <table width='100%' cellSpacing=0 cellPadding=0>
                                                    <tr>
                                                        <td width='395px' style='font-size: 14px;height: 40px;' align='left'>@Model.RemarkContent</td>
                                                        <td nowrap style='border-left: 1px solid #000000;font-size: 16px;height: 40px;'>
                                                            &nbsp;￥
                                                            <span width='100px' name='jeAccount'>@Model.Money</span>元
                                                        </td>
                                                    </tr>
                                                </table>
                                            </td>
                                        </tr>
                                    </table>
                                </td>
                            </tr>

                        </table>

                    </td>

                </tr>
                <tr>
                    <td align='center' style='width:100%;'>
                        <table cellSpacing=0 cellPadding=0 style="width: 600px">
                            <tr align="left" width="100%">
                                <td nowrap="nowrap" style="font-size: 14px;color:#000000;height: 30px;padding-right:50px;">
                                    单位盖章

                                </td>
                                <td nowrap="nowrap" style="font-size: 14px;color:#000000;height: 25px;padding-right:10px;">会计：@config?.Accountant</td>
                                <td nowrap="nowrap" style="font-size: 14px;color:#000000;height: 25px;padding-right:10px;">出纳：@config?.Cashier</td>
                                <td nowrap="nowrap" style="font-size: 14px;color:#000000;height: 25px;">经办人：@Model.AgentPeoper</td>
                            </tr>
                        </table>

                    </td>

                </tr>

            </table>

            <br>
            <hr />
            @*<table style='display:;' width="100%" cellspacing="0" cellpadding="0" align="center" border=0>
                    <tr>
                        <td width="30%" align="left"><b>[制单]</b>&nbsp;18824538026&nbsp;2018-05-14</td>
                        <td width="30%" align="left"><b>[提交]</b>&nbsp;&nbsp;</td>
                        <td width="30%" align="center"><b>[审核]</b>&nbsp;18824538026&nbsp;2018-05-14</td>
                    </tr>
                </table>*@

        </div>
    </div>
</form>

@section scripts{
    <script src="~/js/Print.js"></script>
    <script>
        var loadInfo = function () {
            @*var title = "@if (Model.DepositType == DepositType.收押金)
                {
                @("收押金收据")
                }
                else
                {
                @("退押金收据")
                }";
            $('#titleSpan').text("@Model.RestaurantInfoModel.RestaurantName"+":"+title);//标题*@
            //var table = window.opener.getInfo();
            //$('#valueSpanID').append(table);//打印内容
            //var printInit = window.opener.getprintInit();
            //if (!printInit.portrait) {//横打宽度为270mm
            //    $("#printObj").css({ "width": "270mm" });
            //}
            $("#printObj").css({ "width": "270mm" });
            p_init(printInit);
        };
        $(function () {
            loadInfo();
        });

        function pageSet() {
            try {
                p_pagesetup();
            } catch (e) {
                wb.execwb(8, 1);
            }
        }
        function pageView() {
            try {
                p_preview();
            } catch (e) {
                wb.execwb(7, 1);
            }
        }
        function pagePrint() {
            try {
                p_print();
            } catch (e) {
                wb.execwb(6, 6);
            }
        }
    </script>
}

